import Mock from 'mockjs';

export default [{
		key: "/permission/all",
		method: "get",
		data: Mock.mock({
			'STATUS': "SUCCESS",
			'DATA': [{
					code: "mm",
					name: "工作台",
					type: "P",
					path: "/",
					icon: "md-laptop",
					mFlg: true,
					sort: 100000,
					pCode: '0',
					permissions: [{
							code: 'leave_new',
							name: "新增请假",
							path: "",
							type: "D",
							mFlg: false,
							pCode: "mm",
							sort: 110000,
						},
						{
							code: 'leave_detail',
							name: "请假详细",
							path: "",
							type: "D",
							mFlg: false,
							pCode: "mm",
							sort: 120000,
						},
					]
				},
				{
					code: "mo",
					name: "组织管理",
					icon: "md-home",
					type: "M",
					mFlg: true,
					sort: 200000,
					pCode: '0',
					permissions: [{
							code: 'dept',
							name: "部门列表",
							path: "/dept",
							type: "P",
							mFlg: true,
							pCode: "mo",
							sort: 210000,
							permissions: [{
									code: 'dept_new',
									name: "新增部门",
									path: "",
									type: "D",
									mFlg: true,
									pCode: "dept",
									sort: 211000
								},
								{
									code: 'dept_info',
									name: "部门详细",
									path: "/dept/info",
									type: "P",
									mFlg: false,
									pCode: "dept",
									sort: 212000,
									permissions: [{
											code: 'job_new',
											name: "新增职位",
											path: "",
											type: "D",
											mFlg: false,
											pCode: "dept_info",
											sort: 212100,
											permissions: [{
												code: 'job_submit',
												name: "职位新增",
												path: "",
												type: "B",
												mFlg: false,
												pCode: "job_new",
												sort: 212110,
											}]
										},

										{
											code: 'job_detail',
											name: "职位详细",
											path: "",
											type: "D",
											mFlg: false,
											pCode: "dept_info",
											sort: 212200,
											permissions: [{
												code: 'job_save',
												name: "职位保存",
												path: "",
												type: "B",
												mFlg: false,
												pCode: "job_detail",
												sort: 212210
											}]
										},

										{
											code: 'flow_new',
											name: "新增流程",
											path: "",
											type: "D",
											mFlg: false,
											pCode: "dept_info",
											sort: 212300
										},

										{
											code: 'flow_detail',
											name: "流程详细",
											path: "",
											type: "D",
											mFlg: false,
											pCode: "dept_info",
											sort: 212400
										},
									]
								},
							]
						},

						{
							code: 'emp',
							name: "员工列表",
							type: "P",
							path: "/emp",
							mFlg: true,
							pCode: "mo",
							sort: 220000,
							permissions: [{
									code: 'emp_new',
									name: "员工新增",
									path: "",
									type: "D",
									mFlg: true,
									pCode: "emp",
									sort: 221000
								},
								{
									code: 'emp_info',
									name: "员工详细",
									path: "/emp/info",
									type: "P",
									mFlg: true,
									pCode: "dept",
									sort: 222000
								},
							]
						},

					],

				},
				{
					code: "ms",
					name: "系统管理",
					icon: "md-apps",
					type: "M",
					mFlg: true,
					sort: 300000,
					pCode: '0',
					permissions: [
						{
							code: 'role',
							name: "角色列表",
							path: "/role",
							type: "P",
							mFlg: true,
							pCode: "ms",
							sort: 310000,
							permissions: [
								{
									code: 'role_new',
									name: "新增角色",
									path: "",
									type: "D",
									mFlg: true,
									pCode: "role",
									sort: 311000,
								},
								{
									code: 'role_detail',
									name: "角色详细",
									path: "",
									type: "D",
									mFlg: true,
									pCode: "role",
									sort: 312000,
									permissions: [
										{
											code: 'role_save',
											name: "保存角色",
											path: "",
											type: "B",
											mFlg: true,
											pCode: "role_detail",
											sort: 312100,
										}
									]
								},
							]
						},
						{
							code: 'permission',
							name: "权限列表",
							path: "/permission",
							type: "P",
							mFlg: true,
							pCode: "ms",
							sort: 320000,
							permissions: [
								{
									code: 'permission_new',
									name: "新增权限",
									path: "",
									type: "D",
									mFlg: true,
									pCode: "permission",
									sort: 321000,
								},
								{
									code: 'permission_detail',
									name: "权限详细",
									path: "",
									type: "D",
									mFlg: true,
									pCode: "permission",
									sort: 322000,
								},
							]
						},
					],
				},
				{
					code: "mcy",
					name: "储运管理",
					icon: "md-setting",
					type: "P",
					mFlg: true,
					sort: 500000,
					pCode: '0',
					permissions: [{
							code: 'ckdj',
							name: "出口单据列表",
							path: "/ckdj",
							type: "M",
							mFlg: true,
							pCode: "mcy",
							sort: 510000,
							permissions: [{
									code: 'ckdj_new',
									name: "新增出口单据",
									path: "/ckdj/new",
									type: "D",
									mFlg: false,
									pCode: "ckdj",
									sort: 511000
								},
								{
									code: 'ckdj_info',
									name: "出口单据详细",
									path: "/ckdj/info",
									type: "D",
									mFlg: false,
									pCode: "ckdj",
									sort: 512000,
								},
							]
						}

					],

				},
			]
		})
	},

	{
		key: "/permission/page",
		method: "get",
		data: () => {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'DATA': {
					'current': 0,
					'size': 10,
					'pages': 6,
					'total': 55,
					"records|10": [{
						'code': '@increment(1)',
						'name': "用户列表",
						'path': "/user",
						'aFlg|1': [true, false],
						'type|1': ['M', 'P', 'A', 'B', 'D'],
						'pCode': 0
					}, ],
				},
			});
		}
	},

	{
		key: "/permission/info",
		method: "get",
		data: () => {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'DATA': {
					'code': '@increment(1)',
					'name': "@ctitle()",
					'path': "/user",
					'aFlg|1': [true, false],
					'type|1': ['M', 'P', 'A', 'B', 'D'],
					'mFlg|1': [true, false],
					'pCode': "permission",
				},
			});
		}
	},

	{
		key: "/permission/info",
		method: "post",
		data: () => {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'DATA': {},
			});
		}
	},

	{
		key: "/permission/info",
		method: "put",
		data: () => {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'DATA': {},
			});
		}
	},

	{
		key: "/permission/info",
		method: "delete",
		data: () => {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'DATA': {},
			});
		}
	},

];